<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>

<h:form>
<h:dataTable binding="#{studentList.dataTable}" value="#{studentList.allStudents}" var="student" headerClass="tableHeader" styleClass="dataTable" rowClasses="oddRow, evenRow">
	<h:column>
		<f:facet name="header">
			<h:outputText value="Imie i nazwisko" />
		</f:facet>
		<h:outputText value="#{student.name}" />
	</h:column>
	<h:column rendered="#{currentUser.teacher}">
		<f:facet name="header">
			<h:outputText value="Nr indeksu" />
		</f:facet>
		<h:outputText value="#{student.indexNumber}" />
	</h:column>
	<h:column>
		<f:facet name="header">
			<h:outputText value="e-mail" />
		</f:facet>
		<h:outputText value="#{student.email}" />
	</h:column>
	<h:column>
		<f:facet name="header">
			<h:outputText value="" />
		</f:facet>
		<h:commandButton  value="Pokaz" action="#{studentList.goToStudentDetails}" />
		<h:commandButton value="Edytuj" action="#{studentList.editStudentDetails}" rendered="#{currentUser.teacher}" />
		<h:commandButton  value="Oceny" action="#{studentList.editStudentMarks}" rendered="#{currentUser.teacher}" />
	</h:column>
</h:dataTable>
<h:commandButton value="Dodaj nowego studenta" action="#{studentList.addStudentDetails}"  rendered="#{currentUser.teacher}"/>
</h:form>